home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 716 < prev    next >
Text File  |  1996-08-06  |  2KB  |  48 lines

  1. Newsgroups: comp.std.c
  2. Path: thinkage.on.ca!dat
  3. From: dat@thinkage.on.ca (David Adrien Tanguay)
  4. Subject: Re: Restrictions on qsort compare function?
  5. Message-ID: <DpKFxB.BGG@thinkage.on.ca>
  6. Sender: news@thinkage.on.ca
  7. Organization: Thinkage Ltd., Kitchener, Ontario
  8. References: <828644274snz@genesis.demon.co.uk> <4k28t4$2g0@sam.inforamp.net> <828726582snz@genesis.demon.co.uk>
  9. Date: Mon, 8 Apr 1996 23:00:47 GMT
  10.  
  11. fred@genesis.demon.co.uk writes:
  12. >Such a comparison function is not consistent with sorting.
  13. >It is not the job of the C standard to define basic computer science terms.
  14. >Sorting has a well defined meaning and your comparison function is
  15. >inconsistent with that meaning.
  16.  
  17. That's just hand-waving. Look at the OOP mess for "basic c.s. terms", or even
  18. the meaning of "function" in the various CS communities. :-)
  19.  
  20. From ANSI X3/TR-1-82 American National Dictionary for Information Processing
  21. Systems (_xxx_ is italics, defined elsewhere in the dictionary):
  22.  
  23. sort
  24. (1) The _operation_ of sorting.
  25. (2) (ISO) To segregate _items_ into groups according to a specified criteria.
  26.     Sorting involves _ordering_, but need not involve _sequencing_ for the
  27.     groups may be arranged in an arbitrary order.
  28. (3) To arrange a _set_ of _items_ according to keys which are used as a
  29.     basis for determining the _sequence_ of the items, e.g., to arrange the
  30.     records of a personnel _file_ into alphabetical sequence by using the
  31.     employee names as _sort keys_.
  32. (4) See _balanced merge sort_, _bubble sort_, [etc. etc.]
  33.  
  34. order
  35. (1) (ISO) A specified arrangement used in ordering. An order need not be
  36.     linear.
  37. (2) (ISO) To place _items_ in an arrangement in accordance with specified
  38.     rules.
  39. (3) (ISO) Deprecated term for _instruction_, _sequence_ (1).
  40.  
  41.  
  42. For Peter Curran: What if a particular comparison function causes some qsort
  43. to go into an infinite loop? Is that a non-conforming qsort or a n-c
  44. comparison function?
  45. -- 
  46. David Tanguay       dat@Thinkage.on.ca       http://www.thinkage.on.ca/~dat/
  47. Thinkage, Ltd.           Kitchener, Ontario, Canada          [43.24N 80.29W]
  48.